﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Manager;
using UnityEngine;

// Token: 0x020002C1 RID: 705
public class CharFemaleRandom : global::CharRandom
{
	// Token: 0x06001141 RID: 4417 RVA: 0x000898C4 File Offset: 0x00087AC4
	public static void RandParameter(global::CharFemale female, int personalityType)
	{
		global::CharFileInfoParameterFemale charFileInfoParameterFemale = female.chaFile.parameterInfo as global::CharFileInfoParameterFemale;
		int length = Enum.GetValues(typeof(global::CharFileInfoParameterFemale.Characteristic)).Length;
		charFileInfoParameterFemale.characteristic = UnityEngine.Random.Range(0, length);
		List<int> list = new List<int>();
		list.Add(0);
		list.Add(1);
		list.Add(2);
		list.Add(4);
		list.Add(5);
		list.Add(7);
		list.Add(8);
		list.Add(10);
		list.Add(11);
        //if (Manager.Game.GetAchievementRelease(7))
        //{
        //    list.Add(3);
        //}
        //if (Manager.Game.GetAchievementRelease(8))
        //{
        //    list.Add(6);
        //}
        //if (Manager.Game.GetAchievementRelease(9))
        //{
        //    list.Add(9);
        //}
        //if (Manager.Game.GetAchievementRelease(10))
        //{
        //    list.Add(12);
        //}
        //if (Manager.Game.GetAchievementRelease(11))
        //{
        //    list.Add(13);
        //}
		int[] array = list.ToArray();
		charFileInfoParameterFemale.impression = array[UnityEngine.Random.Range(0, array.Length)];
		int length2 = Enum.GetValues(typeof(global::CharFileInfoParameterFemale.Attribute)).Length;
		charFileInfoParameterFemale.attribute = UnityEngine.Random.Range(0, length2);
		global::CharFileInfoCustomFemale charFileInfoCustomFemale = female.chaFile.customInfo as global::CharFileInfoCustomFemale;
		charFileInfoCustomFemale.name = female.ListInfo.GetRandName(1);
		Dictionary<int, global::PersonalityIdInfo> personalityIdInfo = female.ListInfo.GetPersonalityIdInfo();
		List<int> list2 = new List<int>();
		foreach (KeyValuePair<int, global::PersonalityIdInfo> keyValuePair in personalityIdInfo)
		{
			if (personalityType == 0)
			{
				if (keyValuePair.Value.type == 0)
				{
					list2.Add(keyValuePair.Value.Id);
				}
			}
			else if (personalityType == 1)
			{
				if (keyValuePair.Value.type == 1)
				{
					list2.Add(keyValuePair.Value.Id);
				}
			}
			else
			{
				list2.Add(keyValuePair.Value.Id);
			}
		}
		int[] array2 = list2.ToArray();
		charFileInfoCustomFemale.personality = array2[UnityEngine.Random.Range(0, array2.Length)];
		charFileInfoCustomFemale.voicePitch = UnityEngine.Random.Range(0.94f, 1.06f);
	}

	// Token: 0x06001142 RID: 4418 RVA: 0x00089B0C File Offset: 0x00087D0C
	public static void RandBody(global::CharFemale female, List<global::CharFemaleRandom.RandomFaceFemaleInfo> lstRandFace, List<global::CharFemaleRandom.RandomBodyFemaleInfo> lstRandSBody, List<global::CharFemaleRandom.RandomBodyFemaleInfo> lstRandNBody, List<global::CharFemaleRandom.RandomBodyFemaleInfo> lstRandLBody, int skinColor, int height, int bustSize, int bodyType, int hairType, bool tattoo, bool elf)
	{
		int index = UnityEngine.Random.Range(0, lstRandFace.Count);
		Array.Copy(lstRandFace[index].shapeValue, female.customInfo.shapeValueFace, lstRandFace[index].shapeValue.Length);
		female.customInfo.headId = lstRandFace[index].headNo;
		female.customInfo.texFaceId = lstRandFace[index].baseTexNo;
		female.customInfo.texFaceDetailId = lstRandFace[index].detailTexNo;
		female.customInfo.faceDetailWeight = lstRandFace[index].detailWeight;
		int num = bodyType;
		if (bodyType == 3)
		{
			if (UnityEngine.Random.Range(0, 100) < 5)
			{
				num = 0;
			}
			else if (UnityEngine.Random.Range(0, 100) < 5)
			{
				num = 2;
			}
			else
			{
				num = 1;
			}
		}
		if (num == 0)
		{
			int index2 = UnityEngine.Random.Range(0, lstRandSBody.Count);
			Array.Copy(lstRandSBody[index2].shapeValue, female.customInfo.shapeValueBody, lstRandSBody[index2].shapeValue.Length);
		}
		else if (num == 1)
		{
			int index3 = UnityEngine.Random.Range(0, lstRandNBody.Count);
			Array.Copy(lstRandNBody[index3].shapeValue, female.customInfo.shapeValueBody, lstRandNBody[index3].shapeValue.Length);
		}
		else
		{
			int index4 = UnityEngine.Random.Range(0, lstRandLBody.Count);
			Array.Copy(lstRandLBody[index4].shapeValue, female.customInfo.shapeValueBody, lstRandLBody[index4].shapeValue.Length);
		}
		if (height == 0)
		{
			female.customInfo.shapeValueBody[0] = UnityEngine.Random.Range(0.1f, 0.35f);
		}
		else if (height == 1)
		{
			female.customInfo.shapeValueBody[0] = UnityEngine.Random.Range(0.35f, 0.65f);
		}
		else if (height == 2)
		{
			female.customInfo.shapeValueBody[0] = UnityEngine.Random.Range(0.65f, 0.9f);
		}
		else
		{
			female.customInfo.shapeValueBody[0] = UnityEngine.Random.Range(0.1f, 0.9f);
		}
		if (bustSize == 0)
		{
			female.customInfo.shapeValueBody[1] = UnityEngine.Random.Range(0.25f, 0.35f);
		}
		else if (bustSize == 1)
		{
			female.customInfo.shapeValueBody[1] = UnityEngine.Random.Range(0.35f, 0.55f);
		}
		else if (bustSize == 2)
		{
			female.customInfo.shapeValueBody[1] = UnityEngine.Random.Range(0.55f, 0.65f);
		}
		else
		{
			female.customInfo.shapeValueBody[1] = UnityEngine.Random.Range(0.25f, 0.65f);
		}
		if (elf)
		{
			female.customInfo.shapeValueFace[64] = UnityEngine.Random.Range(0.1f, 0.9f);
			female.customInfo.shapeValueFace[65] = UnityEngine.Random.Range(0.8f, 0.9f);
		}
		float num2 = 0f;
		float num3 = 0f;
		float num4 = 0f;
		float hue = 0f;
		float saturation = 0f;
		float brightness = 0f;
		float specularIntensity = 0f;
		float specularSharpness = 0f;
		if (UnityEngine.Random.Range(0, 100) < 90)
		{
			float[,] array = new float[,]
			{
				{
					6f,
					0f,
					0.45f,
					6f,
					0f,
					0.65f,
					0.6f,
					0.6f
				},
				{
					6f,
					0f,
					0.45f,
					6f,
					0f,
					0.65f,
					0.6f,
					0.6f
				},
				{
					6f,
					0f,
					0.45f,
					6f,
					0f,
					0.65f,
					0.6f,
					0.6f
				},
				{
					6f,
					0f,
					0.45f,
					6f,
					0f,
					0.65f,
					0.6f,
					0.6f
				},
				{
					6f,
					0f,
					0.45f,
					6f,
					0f,
					0.65f,
					0.6f,
					0.6f
				},
				{
					6f,
					0f,
					0.45f,
					6f,
					0f,
					0.65f,
					0.6f,
					0.6f
				},
				{
					6f,
					0.15f,
					0.5f,
					6f,
					0.15f,
					0.65f,
					0.6f,
					0.6f
				},
				{
					6f,
					0.15f,
					0.5f,
					6f,
					0.15f,
					0.65f,
					0.6f,
					0.6f
				},
				{
					6f,
					0.15f,
					0.5f,
					6f,
					0.15f,
					0.65f,
					0.6f,
					0.6f
				},
				{
					6f,
					0.15f,
					0.5f,
					6f,
					0.15f,
					0.65f,
					0.6f,
					0.6f
				},
				{
					6f,
					0.15f,
					0.5f,
					6f,
					0.15f,
					0.65f,
					0.6f,
					0.6f
				},
				{
					6f,
					0.15f,
					0.5f,
					6f,
					0.15f,
					0.65f,
					0.6f,
					0.6f
				},
				{
					0f,
					0.27f,
					0.6f,
					0f,
					0.27f,
					0.75f,
					0.6f,
					0.6f
				},
				{
					0f,
					0.27f,
					0.6f,
					0f,
					0.27f,
					0.75f,
					0.6f,
					0.6f
				},
				{
					0f,
					0f,
					0.7f,
					0f,
					0f,
					0.85f,
					0.6f,
					0.6f
				},
				{
					50f,
					0.8f,
					0.7f,
					50f,
					0.8f,
					0.85f,
					0.6f,
					0.6f
				},
				{
					0f,
					0.8f,
					0.6f,
					0f,
					0.8f,
					0.75f,
					0.6f,
					0.6f
				},
				{
					36f,
					0.12f,
					0.88f,
					31f,
					0.24f,
					0.81f,
					0.6f,
					0.64f
				},
				{
					94f,
					0f,
					0.4f,
					108f,
					0.07f,
					0.44f,
					0.47f,
					0.87f
				},
				{
					252f,
					0.08f,
					0.39f,
					238f,
					0.08f,
					0.56f,
					0.66f,
					0.62f
				},
				{
					196f,
					0.08f,
					0.89f,
					0f,
					0f,
					0.89f,
					0.54f,
					0.71f
				}
			};
			int num5 = UnityEngine.Random.Range(0, array.GetLength(0));
			num2 = array[num5, 0];
			num3 = array[num5, 1];
			num4 = array[num5, 2];
			hue = array[num5, 3];
			saturation = array[num5, 4];
			brightness = array[num5, 5];
			specularIntensity = array[num5, 6];
			specularSharpness = array[num5, 7];
		}
		else
		{
			num2 = UnityEngine.Random.Range(0f, 359f);
			num3 = UnityEngine.Random.Range(0f, 1f);
			num4 = UnityEngine.Random.Range(0.3f, 0.6f);
			hue = num2;
			saturation = num3;
			brightness = num4 + 0.15f;
			specularIntensity = 0.6f;
			specularSharpness = 0.6f;
		}
		bool flag = false;
		Dictionary<int, global::ListTypeFbx> femaleFbxList = female.ListInfo.GetFemaleFbxList(global::CharaListInfo.TypeFemaleFbx.cf_f_hairB, true);
		List<int> list = new List<int>();
		if (hairType == 0)
		{
			foreach (KeyValuePair<int, global::ListTypeFbx> keyValuePair in femaleFbxList)
			{
				if (keyValuePair.Value.Type == 2)
				{
					list.Add(keyValuePair.Key);
				}
			}
		}
		else if (hairType == 1)
		{
			foreach (KeyValuePair<int, global::ListTypeFbx> keyValuePair2 in femaleFbxList)
			{
				if ((keyValuePair2.Value.Type == 0 || keyValuePair2.Value.Type == 1) && "1" == keyValuePair2.Value.Etc[1])
				{
					list.Add(keyValuePair2.Key);
				}
			}
		}
		else if (hairType == 2)
		{
			foreach (KeyValuePair<int, global::ListTypeFbx> keyValuePair3 in femaleFbxList)
			{
				if (keyValuePair3.Value.Type == 4)
				{
					list.Add(keyValuePair3.Key);
				}
			}
		}
		else if (hairType == 3)
		{
			foreach (KeyValuePair<int, global::ListTypeFbx> keyValuePair4 in femaleFbxList)
			{
				if (keyValuePair4.Value.Type == 3)
				{
					list.Add(keyValuePair4.Key);
				}
			}
		}
		else if (hairType == 4)
		{
			foreach (KeyValuePair<int, global::ListTypeFbx> keyValuePair5 in femaleFbxList)
			{
				if (keyValuePair5.Value.Type == 5)
				{
					list.Add(keyValuePair5.Key);
				}
			}
		}
		else
		{
			foreach (KeyValuePair<int, global::ListTypeFbx> keyValuePair6 in femaleFbxList)
			{
				if (!("0" == keyValuePair6.Value.Etc[1]))
				{
					list.Add(keyValuePair6.Key);
				}
			}
		}
		int index5 = UnityEngine.Random.Range(0, list.Count);
		if ("1" == femaleFbxList[list[index5]].Etc[0])
		{
			flag = true;
		}
		female.customInfo.hairId[0] = list[index5];
		if (!flag)
		{
			Dictionary<int, global::ListTypeFbx> femaleFbxList2 = female.ListInfo.GetFemaleFbxList(global::CharaListInfo.TypeFemaleFbx.cf_f_hairF, true);
			int index6 = UnityEngine.Random.Range(1, femaleFbxList2.Count);
			female.customInfo.hairId[1] = femaleFbxList2.ElementAt(index6).Key;
			if (UnityEngine.Random.Range(0, 100) < 50)
			{
				Dictionary<int, global::ListTypeFbx> femaleFbxList3 = female.ListInfo.GetFemaleFbxList(global::CharaListInfo.TypeFemaleFbx.cf_f_hairS, true);
				int index7 = UnityEngine.Random.Range(1, femaleFbxList3.Count);
				female.customInfo.hairId[2] = femaleFbxList3.ElementAt(index7).Key;
			}
			else
			{
				female.customInfo.hairId[2] = 0;
			}
		}
		else
		{
			female.customInfo.hairId[1] = 0;
			female.customInfo.hairId[2] = 0;
		}
		female.customInfo.hairColor[0].hsvDiffuse.Copy(new global::HsvColor(num2, num3, num4));
		female.customInfo.hairColor[0].hsvSpecular.Copy(new global::HsvColor(hue, saturation, brightness));
		female.customInfo.hairColor[0].specularIntensity = specularIntensity;
		female.customInfo.hairColor[0].specularSharpness = specularSharpness;
		female.customInfo.hairColor[1].hsvDiffuse.Copy(new global::HsvColor(num2, num3, num4));
		female.customInfo.hairColor[1].hsvSpecular.Copy(new global::HsvColor(hue, saturation, brightness));
		female.customInfo.hairColor[1].specularIntensity = specularIntensity;
		female.customInfo.hairColor[1].specularSharpness = specularSharpness;
		female.customInfo.hairColor[2].hsvDiffuse.Copy(new global::HsvColor(num2, num3, num4));
		female.customInfo.hairColor[2].hsvSpecular.Copy(new global::HsvColor(hue, saturation, brightness));
		female.customInfo.hairColor[2].specularIntensity = specularIntensity;
		female.customInfo.hairColor[2].specularSharpness = specularSharpness;
		int num6 = 0;
		float[,] array2 = new float[,]
		{
			{
				13f,
				0.08f,
				0.73f,
				0f,
				0f,
				0.8f,
				0.6f,
				0.6f
			},
			{
				15f,
				0.07f,
				0.71f,
				0f,
				0f,
				0.82f,
				0.2f,
				0.9f
			},
			{
				16f,
				0.11f,
				0.72f,
				0f,
				0.04f,
				0.9f,
				0.21f,
				0.76f
			},
			{
				14f,
				0.1f,
				0.71f,
				0f,
				0.02f,
				0.9f,
				0.5f,
				0.5f
			},
			{
				18f,
				0.18f,
				0.7f,
				0f,
				0.04f,
				0.9f,
				0.47f,
				0.72f
			},
			{
				16f,
				0.15f,
				0.73f,
				7f,
				0.16f,
				0.76f,
				0.16f,
				0.62f
			}
		};
		if (skinColor == 0)
		{
			num6 = UnityEngine.Random.Range(0, 2);
			female.customInfo.skinColor.hsvDiffuse = new global::HsvColor(array2[num6, 0], array2[num6, 1], array2[num6, 2]);
			female.customInfo.skinColor.hsvSpecular = new global::HsvColor(array2[num6, 3], array2[num6, 4], array2[num6, 5]);
			female.customInfo.skinColor.specularIntensity = array2[num6, 6];
			female.customInfo.skinColor.specularSharpness = array2[num6, 7];
		}
		else if (skinColor == 1)
		{
			num6 = UnityEngine.Random.Range(2, 4);
			female.customInfo.skinColor.hsvDiffuse = new global::HsvColor(array2[num6, 0], array2[num6, 1], array2[num6, 2]);
			female.customInfo.skinColor.hsvSpecular = new global::HsvColor(array2[num6, 3], array2[num6, 4], array2[num6, 5]);
			female.customInfo.skinColor.specularIntensity = array2[num6, 6];
			female.customInfo.skinColor.specularSharpness = array2[num6, 7];
		}
		else if (skinColor == 2)
		{
			num6 = UnityEngine.Random.Range(4, 6);
			female.customInfo.skinColor.hsvDiffuse = new global::HsvColor(array2[num6, 0], array2[num6, 1], array2[num6, 2]);
			female.customInfo.skinColor.hsvSpecular = new global::HsvColor(array2[num6, 3], array2[num6, 4], array2[num6, 5]);
			female.customInfo.skinColor.specularIntensity = array2[num6, 6];
			female.customInfo.skinColor.specularSharpness = array2[num6, 7];
		}
		else
		{
			int[] array3 = new int[]
			{
				0,
				1,
				2,
				2,
				2,
				2,
				2,
				3,
				3,
				3,
				3,
				3,
				4,
				5
			};
			num6 = array3[UnityEngine.Random.Range(0, array3.Length)];
			female.customInfo.skinColor.hsvDiffuse = new global::HsvColor(array2[num6, 0], array2[num6, 1], array2[num6, 2]);
			female.customInfo.skinColor.hsvSpecular = new global::HsvColor(array2[num6, 3], array2[num6, 4], array2[num6, 5]);
			female.customInfo.skinColor.specularIntensity = array2[num6, 6];
			female.customInfo.skinColor.specularSharpness = array2[num6, 7];
		}
		if (tattoo)
		{
			if (UnityEngine.Random.Range(0, 100) < 10)
			{
				Dictionary<int, global::ListTypeTexture> femaleTextureList = female.ListInfo.GetFemaleTextureList(global::CharaListInfo.TypeFemaleTexture.cf_t_tattoo_f, true);
				List<int> list2 = new List<int>();
				foreach (KeyValuePair<int, global::ListTypeTexture> keyValuePair7 in femaleTextureList)
				{
					int randomRate = keyValuePair7.Value.RandomRate;
					for (int i = 0; i < randomRate; i++)
					{
						list2.Add(keyValuePair7.Key);
					}
				}
				int index8 = UnityEngine.Random.Range(0, list2.Count);
				female.customInfo.texTattoo_fId = list2[index8];
				float[,] array4 = new float[,]
				{
					{
						0f,
						0.2f,
						0.2f
					},
					{
						0f,
						0.5f,
						0.5f
					}
				};
				int num7 = UnityEngine.Random.Range(0, array4.GetLength(0));
				female.customInfo.tattoo_fColor.hsvDiffuse = new global::HsvColor(array4[num7, 0], array4[num7, 1], array4[num7, 2]);
			}
			else
			{
				female.customInfo.texTattoo_fId = 0;
			}
		}
		else
		{
			female.customInfo.texTattoo_fId = 0;
		}
		Dictionary<int, global::ListTypeMaterial> femaleMaterialList = female.ListInfo.GetFemaleMaterialList(global::CharaListInfo.TypeFemaleMaterial.cf_m_eyebrow, true);
		List<int> list3 = new List<int>();
		foreach (KeyValuePair<int, global::ListTypeMaterial> keyValuePair8 in femaleMaterialList)
		{
			int num8 = int.Parse(keyValuePair8.Value.Etc[0]);
			for (int j = 0; j < num8; j++)
			{
				list3.Add(keyValuePair8.Key);
			}
		}
		int index9 = UnityEngine.Random.Range(0, list3.Count);
		female.customInfo.matEyebrowId = list3[index9];
		female.customInfo.eyebrowColor.hsvDiffuse.Copy(new global::HsvColor(num2, num3, num4 * 0.7f));
		female.customInfo.eyebrowColor.hsvSpecular.Copy(new global::HsvColor(hue, saturation, brightness));
		female.customInfo.eyebrowColor.specularIntensity = 0f;
		female.customInfo.eyebrowColor.specularSharpness = 0f;
		bool flag2 = UnityEngine.Random.Range(0, 100) < 95;
		Dictionary<int, global::ListTypeMaterial> femaleMaterialList2 = female.ListInfo.GetFemaleMaterialList(global::CharaListInfo.TypeFemaleMaterial.cf_m_eyeball, true);
		List<int> list4 = new List<int>();
		foreach (KeyValuePair<int, global::ListTypeMaterial> keyValuePair9 in femaleMaterialList2)
		{
			int num9 = int.Parse(keyValuePair9.Value.Etc[0]);
			for (int k = 0; k < num9; k++)
			{
				list4.Add(keyValuePair9.Key);
			}
		}
		int index10 = UnityEngine.Random.Range(0, list4.Count);
		female.customInfo.matEyeLId = list4[index10];
		female.customInfo.matEyeRId = list4[index10];
		global::HsvColor src = new global::HsvColor(UnityEngine.Random.Range(0f, 359f), 0.25f, 0.5f);
		global::HsvColor src2 = new global::HsvColor(0f, 0f, 0.8f);
		female.customInfo.eyeLColor.hsvDiffuse.Copy(src);
		female.customInfo.eyeLColor.hsvSpecular.Copy(src2);
		if (!flag2)
		{
			src = new global::HsvColor(UnityEngine.Random.Range(0f, 359f), 0.25f, 0.5f);
			src2 = new global::HsvColor(0f, 0f, 0.8f);
		}
		female.customInfo.eyeRColor.hsvDiffuse.Copy(src);
		female.customInfo.eyeRColor.hsvSpecular.Copy(src2);
		if (UnityEngine.Random.Range(0, 100) < 20)
		{
			Dictionary<int, global::ListTypeTexture> femaleTextureList2 = female.ListInfo.GetFemaleTextureList(global::CharaListInfo.TypeFemaleTexture.cf_t_eyeshadow, true);
			List<int> list5 = new List<int>();
			foreach (KeyValuePair<int, global::ListTypeTexture> keyValuePair10 in femaleTextureList2)
			{
				int randomRate2 = keyValuePair10.Value.RandomRate;
				for (int l = 0; l < randomRate2; l++)
				{
					list5.Add(keyValuePair10.Key);
				}
			}
			int index11 = UnityEngine.Random.Range(0, list5.Count);
			female.femaleCustomInfo.texEyeshadowId = list5[index11];
			float[,] array5 = new float[,]
			{
				{
					355f,
					0.28f,
					0.6f
				},
				{
					350f,
					0.45f,
					0.55f
				},
				{
					20f,
					0.6f,
					0.6f
				},
				{
					290f,
					0.15f,
					0.15f
				},
				{
					245f,
					0.25f,
					0.6f
				},
				{
					190f,
					0.7f,
					0.4f
				},
				{
					150f,
					0.5f,
					0.4f
				}
			};
			int num10 = UnityEngine.Random.Range(0, array5.GetLength(0));
			female.femaleCustomInfo.eyeshadowColor.hsvDiffuse = new global::HsvColor(array5[num10, 0], array5[num10, 1], array5[num10, 2]);
			female.femaleCustomInfo.eyeshadowColor.alpha = UnityEngine.Random.Range(0.2f, 0.5f);
		}
		else
		{
			female.femaleCustomInfo.texEyeshadowId = 0;
		}
		if (UnityEngine.Random.Range(0, 100) < 20)
		{
			Dictionary<int, global::ListTypeTexture> femaleTextureList3 = female.ListInfo.GetFemaleTextureList(global::CharaListInfo.TypeFemaleTexture.cf_t_cheek, true);
			int index12 = UnityEngine.Random.Range(0, femaleTextureList3.Count);
			female.femaleCustomInfo.texCheekId = femaleTextureList3.ElementAt(index12).Key;
			female.femaleCustomInfo.cheekColor.alpha = UnityEngine.Random.Range(0.2f, 0.5f);
		}
		else
		{
			female.femaleCustomInfo.texCheekId = 0;
		}
		Dictionary<int, global::ListTypeTexture> femaleTextureList4 = female.ListInfo.GetFemaleTextureList(global::CharaListInfo.TypeFemaleTexture.cf_t_lip, true);
		int index13 = UnityEngine.Random.Range(0, femaleTextureList4.Count);
		female.femaleCustomInfo.texLipId = femaleTextureList4.ElementAt(index13).Key;
		float[,] array6 = new float[,]
		{
			{
				0f,
				0.9f,
				0.5f
			},
			{
				310f,
				0.2f,
				0.7f
			},
			{
				340f,
				0.25f,
				0.7f
			}
		};
		int num11 = UnityEngine.Random.Range(0, array6.GetLength(0));
		female.femaleCustomInfo.lipColor.hsvDiffuse = new global::HsvColor(array6[num11, 0], array6[num11, 1], array6[num11, 2]);
		female.femaleCustomInfo.lipColor.alpha = UnityEngine.Random.Range(0.2f, 0.5f);
		if (UnityEngine.Random.Range(0, 100) < 20)
		{
			Dictionary<int, global::ListTypeTexture> femaleTextureList5 = female.ListInfo.GetFemaleTextureList(global::CharaListInfo.TypeFemaleTexture.cf_t_mole, true);
			int index14 = UnityEngine.Random.Range(0, femaleTextureList5.Count);
			female.femaleCustomInfo.texMoleId = femaleTextureList5.ElementAt(index14).Key;
		}
		else
		{
			female.femaleCustomInfo.texMoleId = 0;
		}
		Dictionary<int, global::ListTypeMaterial> femaleMaterialList3 = female.ListInfo.GetFemaleMaterialList(global::CharaListInfo.TypeFemaleMaterial.cf_m_eyelashes, true);
		int index15 = UnityEngine.Random.Range(0, femaleMaterialList3.Count);
		female.femaleCustomInfo.matEyelashesId = femaleMaterialList3.ElementAt(index15).Key;
		female.femaleCustomInfo.eyelashesColor.hsvDiffuse.Copy(new global::HsvColor(num2, num3, num4 * 0.7f));
		female.femaleCustomInfo.eyelashesColor.hsvSpecular.Copy(new global::HsvColor(hue, saturation, brightness));
		female.femaleCustomInfo.eyelashesColor.specularIntensity = 0f;
		female.femaleCustomInfo.eyelashesColor.specularSharpness = 0f;
		Dictionary<int, global::ListTypeMaterial> femaleMaterialList4 = female.ListInfo.GetFemaleMaterialList(global::CharaListInfo.TypeFemaleMaterial.cf_m_eyehi, true);
		List<int> list6 = new List<int>();
		foreach (KeyValuePair<int, global::ListTypeMaterial> keyValuePair11 in femaleMaterialList4)
		{
			int num12 = int.Parse(keyValuePair11.Value.Etc[0]);
			for (int m = 0; m < num12; m++)
			{
				list6.Add(keyValuePair11.Key);
			}
		}
		int index16 = UnityEngine.Random.Range(0, list6.Count);
		female.femaleCustomInfo.matEyeHiId = list6[index16];
		female.customInfo.texBodyId = 0;
		if (UnityEngine.Random.Range(0, 100) < 10)
		{
			Dictionary<int, global::ListTypeTexture> femaleTextureList6 = female.ListInfo.GetFemaleTextureList(global::CharaListInfo.TypeFemaleTexture.cf_t_detail_b, true);
			int index17 = UnityEngine.Random.Range(0, femaleTextureList6.Count);
			female.customInfo.texBodyDetailId = femaleTextureList6.ElementAt(index17).Key;
			female.customInfo.bodyDetailWeight = UnityEngine.Random.Range(0.1f, 0.2f);
		}
		else
		{
			female.customInfo.texBodyDetailId = 0;
		}
		if (tattoo)
		{
			if (UnityEngine.Random.Range(0, 100) < 10)
			{
				Dictionary<int, global::ListTypeTexture> femaleTextureList7 = female.ListInfo.GetFemaleTextureList(global::CharaListInfo.TypeFemaleTexture.cf_t_tattoo_b, true);
				List<int> list7 = new List<int>();
				foreach (KeyValuePair<int, global::ListTypeTexture> keyValuePair12 in femaleTextureList7)
				{
					int randomRate3 = keyValuePair12.Value.RandomRate;
					for (int n = 0; n < randomRate3; n++)
					{
						list7.Add(keyValuePair12.Key);
					}
				}
				int index18 = UnityEngine.Random.Range(0, list7.Count);
				female.customInfo.texTattoo_bId = list7[index18];
				float[,] array7 = new float[,]
				{
					{
						200f,
						0.3f,
						0.3f
					},
					{
						0f,
						0.2f,
						0.2f
					},
					{
						0f,
						1f,
						0.3f
					}
				};
				int num13 = UnityEngine.Random.Range(0, array7.GetLength(0));
				female.customInfo.tattoo_bColor.hsvDiffuse = new global::HsvColor(array7[num13, 0], array7[num13, 1], array7[num13, 2]);
			}
			else
			{
				female.customInfo.texTattoo_bId = 0;
			}
		}
		else
		{
			female.customInfo.texTattoo_bId = 0;
		}
		if (UnityEngine.Random.Range(0, 100) < 20)
		{
			Dictionary<int, global::ListTypeTexture> femaleTextureList8 = female.ListInfo.GetFemaleTextureList(global::CharaListInfo.TypeFemaleTexture.cf_t_sunburn, true);
			List<int> list8 = new List<int>();
			foreach (KeyValuePair<int, global::ListTypeTexture> keyValuePair13 in femaleTextureList8)
			{
				int randomRate4 = keyValuePair13.Value.RandomRate;
				for (int num14 = 0; num14 < randomRate4; num14++)
				{
					list8.Add(keyValuePair13.Key);
				}
			}
			int index19 = UnityEngine.Random.Range(0, list8.Count);
			female.femaleCustomInfo.texSunburnId = list8[index19];
			global::HsvColor hsvColor = new global::HsvColor(female.customInfo.skinColor.hsvDiffuse.H, female.customInfo.skinColor.hsvDiffuse.S, female.customInfo.skinColor.hsvDiffuse.V);
			hsvColor.V = Mathf.Min(1f, hsvColor.V + 0.1f);
			female.femaleCustomInfo.sunburnColor.hsvDiffuse = hsvColor;
		}
		else
		{
			female.femaleCustomInfo.texSunburnId = 0;
		}
		Dictionary<int, global::ListTypeMaterial> femaleMaterialList5 = female.ListInfo.GetFemaleMaterialList(global::CharaListInfo.TypeFemaleMaterial.cf_m_nip, true);
		int index20 = UnityEngine.Random.Range(0, femaleMaterialList5.Count);
		female.femaleCustomInfo.matNipId = femaleMaterialList5.ElementAt(index20).Key;
		float hue2 = 4f;
		float saturation2;
		float num15;
		if (num6 == 0 || num6 == 1)
		{
			saturation2 = 0.15f;
			num15 = 0.65f;
			for (int num16 = 0; num16 < 10; num16++)
			{
				num15 -= 0.01f;
				if (UnityEngine.Random.Range(0, 100) < 60)
				{
					break;
				}
			}
		}
		else if (num6 == 2 || num6 == 3)
		{
			saturation2 = 0.17f;
			num15 = 0.65f;
			for (int num17 = 0; num17 < 10; num17++)
			{
				num15 -= 0.01f;
				if (UnityEngine.Random.Range(0, 100) < 60)
				{
					break;
				}
			}
		}
		else
		{
			saturation2 = 0.18f;
			num15 = 0.6f;
			for (int num18 = 0; num18 < 5; num18++)
			{
				num15 -= 0.01f;
				if (UnityEngine.Random.Range(0, 100) < 60)
				{
					break;
				}
			}
		}
		female.femaleCustomInfo.nipColor.hsvDiffuse = new global::HsvColor(hue2, saturation2, num15);
		Dictionary<int, global::ListTypeMaterial> femaleMaterialList6 = female.ListInfo.GetFemaleMaterialList(global::CharaListInfo.TypeFemaleMaterial.cf_m_underhair, true);
		int index21 = UnityEngine.Random.Range(0, femaleMaterialList6.Count);
		female.femaleCustomInfo.matUnderhairId = femaleMaterialList6.ElementAt(index21).Key;
		female.femaleCustomInfo.underhairColor.hsvDiffuse.Copy(new global::HsvColor(num2, num3, num4));
		female.femaleCustomInfo.underhairColor.hsvSpecular.Copy(new global::HsvColor(hue, saturation, brightness));
		female.femaleCustomInfo.underhairColor.specularIntensity = specularIntensity;
		female.femaleCustomInfo.underhairColor.specularSharpness = specularSharpness;
		float num19 = 1f - female.femaleCustomInfo.shapeValueBody[1];
		num19 = Mathf.Lerp(0.2f, 0.8f, num19);
		female.femaleCustomInfo.areolaSize = num19;
		float num20 = female.femaleCustomInfo.shapeValueBody[1];
		num20 = Mathf.Lerp(0.3f, 0.7f, num20);
		female.femaleCustomInfo.bustSoftness = num20;
		float num21 = female.femaleCustomInfo.shapeValueBody[1];
		num21 = Mathf.Lerp(0.3f, 0.7f, num21);
		female.femaleCustomInfo.bustWeight = num21;
	}

	// Token: 0x06001143 RID: 4419 RVA: 0x0008B530 File Offset: 0x00089730
	public static void RandClothes(global::CharFemale female, bool accessory, bool megane)
	{
		global::CharFileInfoClothes.Accessory[] array = new global::CharFileInfoClothes.Accessory[10];
		for (int i = 0; i < 10; i++)
		{
			array[i] = new global::CharFileInfoClothes.Accessory();
		}
		int num = 0;
		int num2 = 30;
		if ((accessory && UnityEngine.Random.Range(0, 100) < num2) || megane)
		{
			Dictionary<int, global::ListTypeFbx> accessoryFbxList = female.ListInfo.GetAccessoryFbxList(global::CharaListInfo.TypeAccessoryFbx.ca_f_megane, true);
			List<int> list = new List<int>();
			foreach (KeyValuePair<int, global::ListTypeFbx> keyValuePair in accessoryFbxList)
			{
				int num3 = int.Parse(keyValuePair.Value.SiruABPath);
				for (int j = 0; j < num3; j++)
				{
					list.Add(keyValuePair.Key);
				}
			}
			int index = UnityEngine.Random.Range(0, list.Count);
			array[num].type = 2;
			array[num].id = list[index];
			float[,] array2 = new float[,]
			{
				{
					0f,
					0f,
					0f
				},
				{
					0f,
					0f,
					0f
				},
				{
					0f,
					0f,
					0f
				},
				{
					0f,
					0.6f,
					0.3f
				},
				{
					34f,
					0.55f,
					0.24f
				},
				{
					249f,
					0.67f,
					0.18f
				},
				{
					121f,
					1f,
					0.1f
				}
			};
			int num4 = UnityEngine.Random.Range(0, array2.GetLength(0));
			array[num].color.hsvDiffuse = new global::HsvColor(array2[num4, 0], array2[num4, 1], array2[num4, 2]);
			num4 = UnityEngine.Random.Range(0, array2.GetLength(0));
			array[num].color2.hsvDiffuse = new global::HsvColor(array2[num4, 0], array2[num4, 1], array2[num4, 2]);
			num++;
			num2 -= 5;
		}
		if (num == 0 && accessory && UnityEngine.Random.Range(0, 100) < 5)
		{
			Dictionary<int, global::ListTypeFbx> accessoryFbxList2 = female.ListInfo.GetAccessoryFbxList(global::CharaListInfo.TypeAccessoryFbx.ca_f_face, true);
			List<int> list2 = new List<int>();
			foreach (KeyValuePair<int, global::ListTypeFbx> keyValuePair2 in accessoryFbxList2)
			{
				int num5 = int.Parse(keyValuePair2.Value.SiruABPath);
				for (int k = 0; k < num5; k++)
				{
					list2.Add(keyValuePair2.Key);
				}
			}
			int index2 = UnityEngine.Random.Range(0, list2.Count);
			array[num].type = 3;
			array[num].id = list2[index2];
			num++;
		}
		if (accessory && UnityEngine.Random.Range(0, 100) < num2)
		{
			Dictionary<int, global::ListTypeFbx> accessoryFbxList3 = female.ListInfo.GetAccessoryFbxList(global::CharaListInfo.TypeAccessoryFbx.ca_f_hand, true);
			List<int> list3 = new List<int>();
			foreach (KeyValuePair<int, global::ListTypeFbx> keyValuePair3 in accessoryFbxList3)
			{
				int num6 = int.Parse(keyValuePair3.Value.SiruABPath);
				for (int l = 0; l < num6; l++)
				{
					list3.Add(keyValuePair3.Key);
				}
			}
			int index3 = UnityEngine.Random.Range(0, list3.Count);
			array[num].type = 10;
			array[num].id = list3[index3];
			float[,] array3 = new float[,]
			{
				{
					0f,
					0.8f,
					0.8f
				},
				{
					45f,
					0.8f,
					0.8f
				},
				{
					90f,
					0.8f,
					0.8f
				},
				{
					200f,
					0.8f,
					0.8f
				},
				{
					280f,
					0.8f,
					0.8f
				},
				{
					0f,
					0.4f,
					0.7f
				},
				{
					35f,
					0.4f,
					0.7f
				},
				{
					145f,
					0.4f,
					0.7f
				},
				{
					205f,
					0.4f,
					0.7f
				},
				{
					260f,
					0.4f,
					0.7f
				},
				{
					295f,
					0.4f,
					0.7f
				}
			};
			int num7 = UnityEngine.Random.Range(0, array3.GetLength(0));
			array[num].color.hsvDiffuse = new global::HsvColor(array3[num7, 0], array3[num7, 1], array3[num7, 2]);
			num7 = UnityEngine.Random.Range(0, array3.GetLength(0));
			array[num].color2.hsvDiffuse = new global::HsvColor(array3[num7, 0], array3[num7, 1], array3[num7, 2]);
			num++;
			num2 -= 5;
		}
		if (accessory && UnityEngine.Random.Range(0, 100) < num2)
		{
			float[,] array4 = new float[,]
			{
				{
					0f,
					0.8f,
					0.8f
				},
				{
					45f,
					0.8f,
					0.8f
				},
				{
					90f,
					0.8f,
					0.8f
				},
				{
					200f,
					0.8f,
					0.8f
				},
				{
					280f,
					0.8f,
					0.8f
				},
				{
					0f,
					0.4f,
					0.7f
				},
				{
					35f,
					0.4f,
					0.7f
				},
				{
					145f,
					0.4f,
					0.7f
				},
				{
					205f,
					0.4f,
					0.7f
				},
				{
					260f,
					0.4f,
					0.7f
				},
				{
					295f,
					0.4f,
					0.7f
				}
			};
			int num8 = UnityEngine.Random.Range(0, array4.GetLength(0));
			int num9 = UnityEngine.Random.Range(0, array4.GetLength(0));
			Dictionary<int, global::ListTypeFbx> accessoryFbxList4 = female.ListInfo.GetAccessoryFbxList(global::CharaListInfo.TypeAccessoryFbx.ca_f_ear, true);
			List<int> list4 = new List<int>();
			foreach (KeyValuePair<int, global::ListTypeFbx> keyValuePair4 in accessoryFbxList4)
			{
				int num10 = int.Parse(keyValuePair4.Value.SiruABPath);
				for (int m = 0; m < num10; m++)
				{
					list4.Add(keyValuePair4.Key);
				}
			}
			int index4 = UnityEngine.Random.Range(0, list4.Count);
			array[num].type = 1;
			array[num].id = list4[index4];
			array[num].parentKey = "AP_Earring_L";
			array[num].color.hsvDiffuse = new global::HsvColor(array4[num8, 0], array4[num8, 1], array4[num8, 2]);
			array[num].color2.hsvDiffuse = new global::HsvColor(array4[num9, 0], array4[num9, 1], array4[num9, 2]);
			num++;
			array[num].type = 1;
			array[num].id = list4[index4];
			array[num].parentKey = "AP_Earring_R";
			array[num].color.hsvDiffuse = new global::HsvColor(array4[num8, 0], array4[num8, 1], array4[num8, 2]);
			array[num].color2.hsvDiffuse = new global::HsvColor(array4[num9, 0], array4[num9, 1], array4[num9, 2]);
			num++;
			num2 -= 10;
		}
		if (accessory && UnityEngine.Random.Range(0, 100) < num2)
		{
			Dictionary<int, global::ListTypeFbx> accessoryFbxList5 = female.ListInfo.GetAccessoryFbxList(global::CharaListInfo.TypeAccessoryFbx.ca_f_neck, true);
			List<int> list5 = new List<int>();
			foreach (KeyValuePair<int, global::ListTypeFbx> keyValuePair5 in accessoryFbxList5)
			{
				int num11 = int.Parse(keyValuePair5.Value.SiruABPath);
				for (int n = 0; n < num11; n++)
				{
					list5.Add(keyValuePair5.Key);
				}
			}
			int index5 = UnityEngine.Random.Range(0, list5.Count);
			array[num].type = 4;
			array[num].id = list5[index5];
			float[,] array5 = new float[,]
			{
				{
					0f,
					0.8f,
					0.8f
				},
				{
					45f,
					0.8f,
					0.8f
				},
				{
					90f,
					0.8f,
					0.8f
				},
				{
					200f,
					0.8f,
					0.8f
				},
				{
					280f,
					0.8f,
					0.8f
				},
				{
					0f,
					0.4f,
					0.7f
				},
				{
					35f,
					0.4f,
					0.7f
				},
				{
					145f,
					0.4f,
					0.7f
				},
				{
					205f,
					0.4f,
					0.7f
				},
				{
					260f,
					0.4f,
					0.7f
				},
				{
					295f,
					0.4f,
					0.7f
				}
			};
			int num12 = UnityEngine.Random.Range(0, array5.GetLength(0));
			array[num].color.hsvDiffuse = new global::HsvColor(array5[num12, 0], array5[num12, 1], array5[num12, 2]);
			num12 = UnityEngine.Random.Range(0, array5.GetLength(0));
			array[num].color2.hsvDiffuse = new global::HsvColor(array5[num12, 0], array5[num12, 1], array5[num12, 2]);
			num++;
		}
		if (accessory && UnityEngine.Random.Range(0, 100) < 10)
		{
			Dictionary<int, global::ListTypeFbx> accessoryFbxList6 = female.ListInfo.GetAccessoryFbxList(global::CharaListInfo.TypeAccessoryFbx.ca_f_head, true);
			List<int> list6 = new List<int>();
			foreach (KeyValuePair<int, global::ListTypeFbx> keyValuePair6 in accessoryFbxList6)
			{
				int num13 = int.Parse(keyValuePair6.Value.SiruABPath);
				for (int num14 = 0; num14 < num13; num14++)
				{
					list6.Add(keyValuePair6.Key);
				}
			}
			int index6 = UnityEngine.Random.Range(0, list6.Count);
			array[num].type = 0;
			array[num].id = list6[index6];
			if ("1" == accessoryFbxList6[list6[index6]].SiruPrefab)
			{
				array[num].color.hsvDiffuse.Copy(new global::HsvColor(female.customInfo.hairColor[0].hsvDiffuse.H, female.customInfo.hairColor[0].hsvDiffuse.S, female.customInfo.hairColor[0].hsvDiffuse.V));
			}
			else
			{
				array[num].color.hsvDiffuse = new global::HsvColor(20f, 0.6f, 0.7f);
				array[num].color2.hsvDiffuse = new global::HsvColor(90f, 0.6f, 0.7f);
			}
			num++;
		}
		Dictionary<int, global::RandomClothesInfo> randomClothesInfoF = female.ListInfo.GetRandomClothesInfoF();
		global::RandomClothesInfo randomClothesInfo = null;
		if (randomClothesInfoF.TryGetValue(0, out randomClothesInfo))
		{
			global::CharFileInfoClothesFemale charFileInfoClothesFemale = new global::CharFileInfoClothesFemale();
			int index7 = UnityEngine.Random.Range(0, randomClothesInfo.lstFileName.Count);
			charFileInfoClothesFemale.Load(randomClothesInfo.abName, randomClothesInfo.lstFileName[index7], false);
			for (int num15 = 0; num15 < 10; num15++)
			{
				charFileInfoClothesFemale.accessory[num15].Copy(array[num15]);
			}
			female.chaFile.coordinateInfo.SetInfo(global::CharDefine.CoordinateType.type00, charFileInfoClothesFemale);
		}
		if (randomClothesInfoF.TryGetValue(1, out randomClothesInfo))
		{
			global::CharFileInfoClothesFemale charFileInfoClothesFemale2 = new global::CharFileInfoClothesFemale();
			int index8 = UnityEngine.Random.Range(0, randomClothesInfo.lstFileName.Count);
			charFileInfoClothesFemale2.Load(randomClothesInfo.abName, randomClothesInfo.lstFileName[index8], false);
			for (int num16 = 0; num16 < 10; num16++)
			{
				if (array[num16].type != 2)
				{
					break;
				}
				charFileInfoClothesFemale2.accessory[num16].Copy(array[num16]);
			}
			female.chaFile.coordinateInfo.SetInfo(global::CharDefine.CoordinateType.type01, charFileInfoClothesFemale2);
		}
		if (randomClothesInfoF.TryGetValue(2, out randomClothesInfo))
		{
			global::CharFileInfoClothesFemale charFileInfoClothesFemale3 = new global::CharFileInfoClothesFemale();
			int index9 = UnityEngine.Random.Range(0, randomClothesInfo.lstFileName.Count);
			charFileInfoClothesFemale3.Load(randomClothesInfo.abName, randomClothesInfo.lstFileName[index9], false);
			for (int num17 = 0; num17 < 10; num17++)
			{
				if (array[num17].type != 2)
				{
					break;
				}
				charFileInfoClothesFemale3.accessory[num17].Copy(array[num17]);
			}
			female.chaFile.coordinateInfo.SetInfo(global::CharDefine.CoordinateType.type02, charFileInfoClothesFemale3);
		}
	}

	// Token: 0x040016F7 RID: 5879
	public static int cnt;

	// Token: 0x020002C2 RID: 706
	public class RandomFaceFemaleInfo
	{
		// Token: 0x06001145 RID: 4421 RVA: 0x0008C000 File Offset: 0x0008A200
		public virtual void Load(TextAsset ta)
		{
			using (MemoryStream memoryStream = new MemoryStream())
			{
				memoryStream.Write(ta.bytes, 0, ta.bytes.Length);
				memoryStream.Seek(0L, SeekOrigin.Begin);
				using (BinaryReader binaryReader = new BinaryReader(memoryStream))
				{
					for (int i = 0; i < this.shapeValue.Length; i++)
					{
						this.shapeValue[i] = Mathf.Clamp(binaryReader.ReadSingle(), 0f, 1f);
					}
					this.headNo = binaryReader.ReadInt32();
					this.baseTexNo = binaryReader.ReadInt32();
					this.detailTexNo = binaryReader.ReadInt32();
					this.detailWeight = binaryReader.ReadSingle();
				}
			}
		}

		// Token: 0x040016F8 RID: 5880
		public float[] shapeValue = new float[global::CharDefine.cf_headshapename.Length];

		// Token: 0x040016F9 RID: 5881
		public int headNo;

		// Token: 0x040016FA RID: 5882
		public int baseTexNo;

		// Token: 0x040016FB RID: 5883
		public int detailTexNo;

		// Token: 0x040016FC RID: 5884
		public float detailWeight;
	}

	// Token: 0x020002C3 RID: 707
	public class RandomBodyFemaleInfo
	{
		// Token: 0x06001147 RID: 4423 RVA: 0x0008C0FC File Offset: 0x0008A2FC
		public virtual void Load(TextAsset ta)
		{
			using (MemoryStream memoryStream = new MemoryStream())
			{
				memoryStream.Write(ta.bytes, 0, ta.bytes.Length);
				memoryStream.Seek(0L, SeekOrigin.Begin);
				using (BinaryReader binaryReader = new BinaryReader(memoryStream))
				{
					for (int i = 0; i < this.shapeValue.Length; i++)
					{
						this.shapeValue[i] = Mathf.Clamp(binaryReader.ReadSingle(), 0f, 1f);
					}
				}
			}
		}

		// Token: 0x040016FD RID: 5885
		public float[] shapeValue = new float[global::CharDefine.cf_bodyshapename.Length - 1];
	}
}
